Fix length argument to memmove so we don't mangle the dest string.
authorrobertl <robertl@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Fri, 17 Jun 2005 13:17:09 +0000 (13:17 +0000)
committerrobertl <robertl@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Fri, 17 Jun 2005 13:17:09 +0000 (13:17 +0000)
gpsbabel/util.c

index 4ce40cf4fbdfd8e712d54348b91517d91c5a51b2..e22b83d1a2d06e1d93158178418f1b92cc4f9630 100644 (file)
@@ -895,7 +895,7 @@ char * str_utf8_to_ascii( const char * str )
                                cur += bytes - 1;
                        } else {
                                *cur = (char)value;
-                               memmove(cur+1, cur+bytes, bytes+1);
+                               memmove(cur+1, cur+bytes, strlen(cur+bytes));
                        }
                }
                cur++;